This page describes the steps I follow to setup an Eclipse-based project for developing a new Wicket project. These steps are really just a detailed version of what you can find at: the Wicket quickstart page.
Create a Space
Begin by creating a source directory. For this example, I'll create a directory called CheesrWorkspace (example project from the Wicket in Action book.
macintosh-4% cd ~/src
/Users/schuchert/src
macintosh-4% mkdir CheesrWorkspace
macintosh-4% cd CheesrWorkspace
/Users/schuchert/src/CheesrWorkspace
macintosh-4% git init
Initialized empty Git repository in /Users/schuchert/src/CheesrWorkspace/.git/
macintosh-4%
Note: I'll be using git for revision control, so I also added in that last step to init this newly-created subdirectory as a git repository.
Create Project Using Maven 2
There's a simple form you can fill out on the Wicket quickstart page to create a maven command that will create the project structure.
Fill out the form (I used com.om for the groupid and Cheesr for the artifactid), which produces the following command:
macintosh-4% pwd
/Users/schuchert/src/CheesrWorkspace/Cheesr
macintosh-4% mvn eclipse:eclipse -DdownloadSources=true
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'eclipse'.
[INFO] ------------------------------------------------------------------------
[INFO] Building quickstart
[INFO] task-segment: [eclipse:eclipse]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing eclipse:eclipse
[INFO] No goals needed for project - skipping
[INFO] [eclipse:eclipse]
[INFO] Using Eclipse Workspace: null
[INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAINER
[INFO] Resource directory's path matches an existing source directory. Resources will <snip>
[INFO] Resource directory's path matches an existing source directory. Resources will <snip>
[INFO] Wrote settings to /Users/schuchert/src/CheesrWorkspace/Cheesr/.settings/org.eclipse.jdt.core.prefs
[INFO] Wrote Eclipse project for "Cheesr" to /Users/schuchert/src/CheesrWorkspace/Cheesr.
[INFO]
Javadoc for some artifacts is not available.
Please run the same goal with the -DdownloadJavadocs=true parameter <snip>
List of artifacts without a javadoc archive:
o junit:junit:4.7
o log4j:log4j:1.2.14
o org.apache.wicket:wicket:1.4.1
o org.slf4j:slf4j-api:1.4.2
o org.mortbay.jetty:jetty:6.1.4
o org.mortbay.jetty:jetty-util:6.1.4
o org.mortbay.jetty:servlet-api-2.5:6.1.4
o org.mortbay.jetty:jetty-management:6.1.4
o mx4j:mx4j:3.0.1
o mx4j:mx4j-tools:3.0.1
o org.slf4j:slf4j-log4j12:1.4.2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Wed Sep 23 00:02:17 CDT 2009
[INFO] Final Memory: 14M/79M
[INFO] ------------------------------------------------------------------------
macintosh-4%
Start Eclipse and Create Java Project
Now we need to start Eclipse and make a few minor corrections:
Start Eclipse.
When asked for a directory, select the original directory you created (in my case, that's /Users/schuchert/src/CheesrWorkspace)
Import existing project:
Right-click in Project Explorer
Select Import::Import...
Open General
Select Existing Projects into Workspace
Click Next
Click Browse
Click Open
Click Finish
The generated classpath uses a classpath variable: M2_REPO. Fix that next:
Go to the Eclipse Preferences Window (windows->Window:Preferences, Mac->Command,)
In the filter, type classpath
Select Classpath Variables under Java:Build Path
Click New
For the name, enter M2_REPO
For the path, enter the location of your Maven 2 repository. (In my case, it is ~/.m2/repository, but you must enter the full path, so it is actually: /Users/schuchert/.m2/repository.)
Click Ok
When asked to rebuild all, select Yes
Verify Everything Works
You can start you server to verify that it is working:
Find the Start.java class under src/test/java (in the one package created in the first step above)
Overview
This page describes the steps I follow to setup an Eclipse-based project for developing a new Wicket project. These steps are really just a detailed version of what you can find at: the Wicket quickstart page.Create a Space
Note: I'll be using git for revision control, so I also added in that last step to init this newly-created subdirectory as a git repository.
Create Project Using Maven 2
There's a simple form you can fill out on the Wicket quickstart page to create a maven command that will create the project structure.Update POM
By default, the project depends on JUnit 3.x, so I update the POM.xml to instead depend on a newer version of JUnit.Create Eclipse Project Information
Now that you have an updated POM, you can create the eclipse project. The the Wicket quickstart page has instructions at the bottom.macintosh-4% pwd /Users/schuchert/src/CheesrWorkspace/Cheesr macintosh-4% mvn eclipse:eclipse -DdownloadSources=true [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'eclipse'. [INFO] ------------------------------------------------------------------------ [INFO] Building quickstart [INFO] task-segment: [eclipse:eclipse] [INFO] ------------------------------------------------------------------------ [INFO] Preparing eclipse:eclipse [INFO] No goals needed for project - skipping [INFO] [eclipse:eclipse] [INFO] Using Eclipse Workspace: null [INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAINER [INFO] Resource directory's path matches an existing source directory. Resources will <snip> [INFO] Resource directory's path matches an existing source directory. Resources will <snip> [INFO] Wrote settings to /Users/schuchert/src/CheesrWorkspace/Cheesr/.settings/org.eclipse.jdt.core.prefs [INFO] Wrote Eclipse project for "Cheesr" to /Users/schuchert/src/CheesrWorkspace/Cheesr. [INFO] Javadoc for some artifacts is not available. Please run the same goal with the -DdownloadJavadocs=true parameter <snip> List of artifacts without a javadoc archive: o junit:junit:4.7 o log4j:log4j:1.2.14 o org.apache.wicket:wicket:1.4.1 o org.slf4j:slf4j-api:1.4.2 o org.mortbay.jetty:jetty:6.1.4 o org.mortbay.jetty:jetty-util:6.1.4 o org.mortbay.jetty:servlet-api-2.5:6.1.4 o org.mortbay.jetty:jetty-management:6.1.4 o mx4j:mx4j:3.0.1 o mx4j:mx4j-tools:3.0.1 o org.slf4j:slf4j-log4j12:1.4.2 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3 seconds [INFO] Finished at: Wed Sep 23 00:02:17 CDT 2009 [INFO] Final Memory: 14M/79M [INFO] ------------------------------------------------------------------------ macintosh-4%Start Eclipse and Create Java Project
Now we need to start Eclipse and make a few minor corrections:The generated classpath uses a classpath variable: M2_REPO. Fix that next:
Verify Everything Works
You can start you server to verify that it is working:Congratulations, you are done.